package com.wondertek.poms.dao.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Proxy;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * @author chenjijiang
 * @description
 */
@Data
@Entity
@Table(name = "PUBLISH_LOG")
@DynamicInsert
@DynamicUpdate
@Proxy(lazy = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PublishLog implements Serializable {
	private static final long serialVersionUID = 341368294709465100L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PUBLISH_LOG_SEQ")
	@SequenceGenerator(name = "PUBLISH_LOG_SEQ", allocationSize = 1, sequenceName = "PUBLISH_LOG_SEQ")
	private Long id;    //主键

	@Column(name = "PRD_CONT_ID")
	private Long prdContId;    //节目ID

	@Column(name = "CONT_ID")
	private Long contId;    //内容ID

	@Column(name = "STATUS")
	private Integer status;    //发布 （新）状态

	@Column(name = "CREATE_USER_NAME")
	private String createUserName;    //创建人名称

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "CREATE_DATE")
	private Date createTime;    //创建时间

	@Column(name = "PRD_INFO_ID")
	private Long prdInfoId;    //产品包ID

	@Column(name = "CONT_NAME")
	private String contName;    //内容名称

	@Column(name = "OPR_CODE")
	private Long oprCode;       //内容状态(0-新增, 1-变更不涉及媒体文件， 2-删除， 3-变更涉及媒体文件)-----用于发布新统计

	/**
	 * 发布失败-发布失败原因
	 * 撤回：1：匹配释放规则，撤回 2:移包而撤回 3:定时任务撤回 4:播控拒绝被撤回
	 * 5:cis无媒体文件被撤回   6.cis撤回 7.强制下线 8手动撤回 9央视调用撤回接口撤回
	 * 10:符合限制规则撤回  11：版权替换撤回   12：央视调用节目展示上下线撤回 13:内容同步删除撤回14:内容变更后不符合入包规则撤回15:手动删除撤回 16:无发布规则的节目被播控方撤回
	 * <p>
	 * 20:定时任务发布  21:先发布后播控   22:cdi发布 23:未来电视播控后发布
	 * 24:手动播控后发布 25:移包后发布 26:一键移包后发布 27:计划移包后发布 28:手动发布 29:4g播控后发布
	 * 30:先审后上播控   31:已内审不请求外部播控
	 */
	@Column(name = "REMARK")
	private String remarks;

}
